package com.zr.serviceImpl;

import java.sql.Connection;
import java.sql.SQLException;

import com.zr.dao.RejectDaoljc;
import com.zr.daoImpl.RejectDaoImplljc;
import com.zr.service.PasssqServiceljc;
import com.zr.service.RejectServiceljc;
import com.zr.util.JDBCUtil;

public class RejectServiceImplljc implements RejectServiceljc{
	RejectDaoljc r = new RejectDaoImplljc();
	
	//驳回申请
	@Override
	public boolean rejectSQ(int id,int sid,String sname, String tname, String cname, String score, String zt, String sj, String newsj,
			String nr) {
		boolean flag = true;
		Connection con = JDBCUtil.getConnection();
		try {
			con.setAutoCommit(false);
			r.deleteapply(id, con);
			r.insertBlog(sid, tname, cname, score, zt, sj, newsj, nr, con);
			r.insertTblog(sid, tname, sname, cname, score, zt, sj, newsj, nr, con);
			con.commit();
		} catch (SQLException e) {
			try {
				flag = false;
				con.rollback();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return flag;
	}

}
